<div id="bloc_description" style="margin-top:10px;">
	<form action="?nom=<?php echo $nom; ?>&amp;page=configuration" name="configuration" id="formulaire" method="POST">
 		<input type="hidden" name="lang" value="<?php echo($lang); ?>" /> 
		<div class="entete_liste_config" style="width:970px">
			<div class="titre">CONFIGURATION MULTILINGUE</div>
			<div class="fonction_valider">
				<a href="#" onclick="document.getElementById('formulaire').submit();">VALIDER</a>
			</div>
		</div>
		<table width="100%" cellpadding="5" cellspacing="0" style="width: 976px;">
			<tr class="claire">
     			<td class="designation" style="width:180px;">Changer la langue</td>
        		<td>
        			<?php
						$langl = new Lang();
						$query = "select * from $langl->table";
						$resul = mysql_query($query);
						while($row = mysql_fetch_object($resul)){
							$langl->charger($row->id);
							?>
							<div class="flag<?php if($lang ==  $langl->id) { ?>Selected<?php } ?>">
								<a href="<?php echo($_SERVER['PHP_SELF']); ?>?nom=<?php echo $nom; ?>&page=configuration&lang=<?php echo($langl->id); ?>">
									<img src="gfx/lang<?php echo($langl->id); ?>.gif" />
								</a>
							</div><?php 
						} 
					?>
        		</td>
   			</tr>
   			<?php
   			
   			// Update d'une langue
 		    if ($_POST['updatelangue']==1) {
 		    	$DC_NEWSLETTER_BASIC_LANG_TITRE=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_TITRE']);
				$DC_NEWSLETTER_BASIC_LANG_EMAIL=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_EMAIL']);
				$DC_NEWSLETTER_BASIC_LANG_NOM=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_NOM']);
				$DC_NEWSLETTER_BASIC_LANG_PRENOM=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_PRENOM']);
				$DC_NEWSLETTER_BASIC_LANG_CHOIX=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_CHOIX']);
				$DC_NEWSLETTER_BASIC_LANG_CHOISISSEZ=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_CHOISISSEZ']);
				$DC_NEWSLETTER_BASIC_LANG_ABONNER=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_ABONNER']);
				$DC_NEWSLETTER_BASIC_LANG_DESABONNER=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_DESABONNER']);
				$DC_NEWSLETTER_BASIC_LANG_VALIDER=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_VALIDER']);
				$DC_NEWSLETTER_BASIC_LANG_OBLIGATOIRE=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_OBLIGATOIRE']);
				$DC_NEWSLETTER_BASIC_LANG_ABO_OK=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_ABO_OK']);
				$DC_NEWSLETTER_BASIC_LANG_ABO_EXISTE=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_ABO_EXISTE']);
				$DC_NEWSLETTER_BASIC_LANG_ABO_EMAIL=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_ABO_EMAIL']);
				$DC_NEWSLETTER_BASIC_LANG_DESABO_OK=addslashes($_POST['DC_NEWSLETTER_BASIC_LANG_DESABO_OK']);
 		           		
 		        $newsletter = new dc_newsletter_basic();
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_TITRE' WHERE cle='DC_NEWSLETTER_BASIC_LANG_TITRE' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_EMAIL' WHERE cle='DC_NEWSLETTER_BASIC_LANG_EMAIL' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_NOM' WHERE cle='DC_NEWSLETTER_BASIC_LANG_NOM' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_PRENOM' WHERE cle='DC_NEWSLETTER_BASIC_LANG_PRENOM' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_CHOIX' WHERE cle='DC_NEWSLETTER_BASIC_LANG_CHOIX' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_CHOISISSEZ' WHERE cle='DC_NEWSLETTER_BASIC_LANG_CHOISISSEZ' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_ABONNER' WHERE cle='DC_NEWSLETTER_BASIC_LANG_ABONNER' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_DESABONNER' WHERE cle='DC_NEWSLETTER_BASIC_LANG_DESABONNER' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_VALIDER' WHERE cle='DC_NEWSLETTER_BASIC_LANG_VALIDER' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_OBLIGATOIRE' WHERE cle='DC_NEWSLETTER_BASIC_LANG_OBLIGATOIRE' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_ABO_OK' WHERE cle='DC_NEWSLETTER_BASIC_LANG_ABO_OK' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_ABO_EXISTE' WHERE cle='DC_NEWSLETTER_BASIC_LANG_ABO_EXISTE' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_ABO_EMAIL' WHERE cle='DC_NEWSLETTER_BASIC_LANG_ABO_EMAIL' AND langue='$lang'");
 		        $update =  mysql_query("UPDATE $newsletter->table_multilingue SET traduction='$DC_NEWSLETTER_BASIC_LANG_DESABO_OK' WHERE cle='DC_NEWSLETTER_BASIC_LANG_DESABO_OK' AND langue='$lang'");
			}
   			
   			// Création de la nouvelle langue
   			if ($_POST['creerlangue']==1) {
				$creerlangue = new dc_newsletter_basic();
				$query = "SELECT * FROM $creerlangue->table_multilingue WHERE langue='1'";
            	$resul = mysql_query($query, $creerlangue->link);
            	if (!$resul) {
    				die('Erreur: ' . mysql_error() . '<br/>Req: ' . $query );
				}
				$i = 0;
				while($row = mysql_fetch_object($resul)) {
					$i++;
					$traduction = addslashes($row->traduction);
					$nouveau = mysql_query("INSERT INTO $creerlangue->table_multilingue VALUES('', '$row->cle', '$traduction', '$lang' )");
				}
			}
   			
			$traduction = new dc_newsletter_basic();
    		$query = "SELECT * FROM $traduction->table_multilingue WHERE langue=$lang";
            $resul = mysql_query($query, $traduction->link);
            if (!$resul) {
    			die('Erreur: ' . mysql_error() . '<br/>Req: ' . $query );
			}
			
			if (mysql_num_rows($resul)){
				?>
				<input type="hidden" name="updatelangue" value="1" />
				<?php
            	$i = 0;
            	while($row = mysql_fetch_object($resul)) {
					$i++;
				?>	
					<tr class="fonce">
       					<td class="designation" style="width:180px;">Cl&eacute; - Valeur par d&eacute;fault</td>
       					<td>
       						<?php echo $row->cle; ?>
       					</td>
   					</tr>
					<tr class="claire" style="border-bottom: 1px solid #62BD19;">
  						<td class="designation" style="width:180px;">Traduction</td>
       					<td>
        					<input type="text" class="form_long" name="<?php echo $row->cle;?>" value="<?php echo $row->traduction;?>" />
        				</td>
   					</tr>
   				<?php
    			}
    		} else {
    			?>
    				<tr class="fonce">
       					<td class="designation" style="width:180px;">Cette langue n'existe pas.
       						<br/>Souhaitez-vous la cr&eacute;er ?
       					</td>
       					<td>
       						<input type="radio" name="creerlangue" value="1" checked />Oui
       						<input type="radio" name="creerlangue" value="O" />Non
       					</td>
   					</tr>
   				<?php
    		}
   			?>   			
   			
			<tr class="clairebottom">
				<td class="designation" style="width:180px;">&nbsp;</td>
				<td>
					&nbsp;
				</td>
			</tr>
		</table>
	</form>
</div>